<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .style01 {
            color: red;
            font-size: 50px;
        }
        .style02 {
            color: purple;
            font-size: 100px;
        }
    </style>
</head>
<body>
<div id="app">
    <H1 :class="style">学习使用v-bind</H1>

    <hr/>
    请选择你想要的样式：
    <label for="red"></label><input type="radio" name="color" value="style01" id="red" @click="toRed"/>红色
    <label for="purple"></label><input type="radio" name="color" value="style02" id="purple" @click="toPurple"/>紫色

</div>
</body>
</html>
<script src="../../js/vue.js"></script>
<script>
    new Vue({
        el: "#app",
        data: {
            style: undefined,
        },
        methods: {
            toRed() {
                this.style = 'style01'
            },
            toPurple() {
                this.style = 'style02'
            },
        },

    })
</script>

